const userToken = 'userToken'
const userMsg = 'userMsg'
const userPhone = 'userPhone'
const userLatitude = 'latitude'
const userLongitude = 'longitude'

//存取token--->本地缓存
export function getUserToken() {
    return uni.getStorageSync(userToken)
}
  
export function setUserToken(info) {
    try {
        return uni.setStorageSync(userToken, info)
    } catch (e) {
        return this.setstorage(userToken, info)
    }
}
export function removeUserToken() {
    return uni.removeStorageSync(userToken)
}


//存取用户userID--->本地缓存
export function getUserMsg() {
    return uni.getStorageSync(userMsg)
}
  
export function setUserMsg(info) {
    try {
        return uni.setStorageSync(userMsg, info)
    } catch (e) {
        return this.setstorage(userMsg, info)
    }
}
export function removeUserMsg() {
    return uni.removeStorageSync(userMsg)
}

//存取用户手机号--->本地缓存
export function getUserPhone() {
    return uni.getStorageSync(userPhone)
}
  
export function setUserPhone(info) {
    try {
        return uni.setStorageSync(userPhone, info)
    } catch (e) {
        return this.setstorage(userPhone, info)
    }
}
export function removeUserPhone() {
    return uni.removeStorageSync(userPhone)
}

//存取纬度到本地--->本地缓存
export function getLatitude() {
    return uni.getStorageSync(userLatitude)
  }
  
  export function setLatitude(token) {
    try {
      return uni.setStorageSync(userLatitude, token)
    } catch (e) {
      return this.setstorage(userLatitude, token)
    }
  }
  export function removeLatitude() {
    return uni.removeStorageSync(userLatitude)
  }
  
  //存取经度到本地--->本地缓存
  export function getLongitude() {
    return uni.getStorageSync(userLongitude)
  }
  
  export function setLongitude(token) {
    try {
      return uni.setStorageSync(userLongitude, token)
    } catch (e) {
      return this.setstorage(userLongitude, token)
    }
  }
  export function removeLongitude() {
    return uni.removeStorageSync(userLatitude)
  }